package cn.car.domains.enums;

import lombok.Getter;

@Getter
public enum FuelTypeEnum {

    A("汽油"),
    B("柴油"),
    C("电"),
    D("天然气"),
    E("氢"),
    F("混合动力"),
    G("液化石油气"),
    H("太阳能"),
    J("乙醇"),
    K("甲醇"),
    L("生物燃料"),
    M("混合油"),
    Z("其它");

    private final String desc;

    FuelTypeEnum(String desc) {
        this.desc = desc;
    }

    public static String getEnumByDesc(String desc){
        for (FuelTypeEnum value : values()) {

            if (value.getDesc().equals(desc)){
                return value.name();
            }
        }
        return FuelTypeEnum.Z.name();
    }


    public static void main(String[] args) {
        for (FuelTypeEnum value : FuelTypeEnum.values()) {
            System.out.println("'"+value.name()+"': { text: '"+value.desc+"' },");
        }
    }
}
